home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Telnet / NCSA / tn3270 2.3d26 source / tn3270 / globals.c < prev    next >
Text File  |  1991-06-03  |  10KB  |  268 lines

  1. /*
  2.  *  tn3270 for the Macintosh Source Code
  3.  *  Brown University Computing and Information Services
  4.  *  Version 2.3d21, January 17, 1991
  5.  *  Copyright (c) 1988, 1989, 1990, 1991 by Brown University and by
  6.  *  Peter John DiCamillo.
  7.  *
  8.  *  Permission is granted to any individual or institution to use, copy,
  9.  *  or redistribute the binary version of this software and its
  10.  *  documentation provided this notice and the copyright notices are
  11.  *  retained.  Permission is granted to any individual or non-profit
  12.  *  institution to use, copy, modify, or redistribute the source files
  13.  *  of this software provided this notice and the copyright notices are
  14.  *  retained.  This software may not be distributed for profit, either
  15.  *  in original form or in derivative works, nor can the source be
  16.  *  distributed to other than an individual or a non-profit institution.
  17.  *  Any  individual or group interested in seeing and/or using these
  18.  *  source files but who are prevented from doing so by the above
  19.  *  constraints should contact Don Wolfe, Assistant Vice-President for
  20.  *  Computer Systems at Brown University, (401) 863-7250, for possible
  21.  *  software licensing of the source developed at Brown.
  22.  *
  23.  *  Brown University and Peter John DiCamillo make no representations
  24.  *  about the suitability of this software for any purpose.
  25.  *
  26.  *  BROWN UNIVERSITY AND PETER JOHN DICAMILLO GIVE NO WARRANTY, EITHER
  27.  *  EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION PROVIDED,
  28.  *  INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY AND
  29.  *  WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
  30.  *
  31.  */
  32.  
  33. #include "maclib.h"
  34. #include "termdef.h"
  35.  
  36. char done;                /* flag for mainline to return */
  37. char connflg;            /* flag for initial connect mode */
  38. char netconn;            /* flag for current AppleTalk session */
  39.  
  40. unsigned char * readbuff;    /* transmitted diag data */
  41. short rbsize;                /* number of bytes in readbuff */
  42. short rballoc;                /* allocated size of readbuff */
  43.  
  44. struct Rect screenRect, dragRect, pRect, sizeRect;
  45. struct WindowRecord wRecord;
  46. struct GrafPort *myWindow;
  47. char **myMenus[NMENUS];
  48. char ** kybdMenu;
  49. char ** nlMenu;
  50.  
  51. GrafPort WritePort;
  52. GrafPtr WritePtr;
  53. char * mapptr;
  54. GrafPort PictPort;
  55. GrafPtr PictPtr;
  56. char * pmapptr;
  57. char drawpict;
  58. char newpict;
  59. struct WindowRecord * whichWindow;
  60. struct EventRecord myEvent;
  61. struct Cursor **grafcursor;
  62. char dfltcurs;
  63.  
  64. char kblock, kblcode, aplmode, insmode, online;
  65.  
  66. short ldvoff;
  67. char ptfill;
  68. unsigned char * chrbuff;
  69. unsigned short * atrbuff;
  70. scrapline * scrapstart;
  71. short scrapalloc, scrapsize, scrapwidth;
  72. short curadr;
  73. short bufadr;
  74. short chratr;
  75. unsigned char lastwcc;
  76. char fmtscrn;
  77. short WriteCurr;
  78. unsigned char rdaid = 0x60;
  79. struct Rect er;
  80. short x,y;
  81. struct Rect inrect = {32767, 32767, -32767, -32767};
  82. short in_len = 0;
  83. short in_off, in_atr;
  84. kbdata kbqueue[KBQMAX];        /* keyboard input queue */
  85. short kbqsize;
  86. unsigned char dfltmap[7] = {0x00, 0x40, 0x80, 0x20,
  87.                             0x30, 0x10, 0x80};
  88. char addr14;                    /* generate 14-bit addresses for this session */
  89. char serflg;                    /* 0 = AppleTalk; 1 = async */
  90. char tcpflg;                    /* 0 = PC Net; 1 = TCP/IP */
  91. char dfltsflg;                    /* default connection for commdlg */
  92.  
  93. char apiopen;                    /* true if current session opened by API */
  94.                                 /* API data when apiopen is true:        */
  95. char apiopenpend;                /* api open response not sent yet */
  96. unsigned char *apihostname;        /* host name for API session */
  97. unsigned char *apiwindowname;    /* window name for API session */
  98. OpenRequest apiopenreq;            /* API open request data */
  99. short apiopenrefnum;            /* SPPC client refnum for open */
  100. unsigned long apiopensref;        /* PPC session refnum for open */
  101. char apiopenkind;                /* 0 = PPC, 1 = SPPC */
  102. unsigned long apiopenmsgid;        /* SPPC/PPC message id of open request */
  103. char apiclosenotify;            /* true if close notification wanted */
  104. short apicloserefnum;            /* SPPC client refnum for notify */
  105. unsigned long apiclosesref;        /* PPC session refnum for close */
  106. char apiclosekind;                /* 0 = PPC, 1 = SPPC */
  107. unsigned long apiclosemsgid;    /* SPPC/PPC message id of notify request */
  108. char apiwritenotify;            /* true if write notification wanted */
  109. short apiwriterefnum;            /* SPPC client refnum for notify */
  110. unsigned long apiwritesref;        /* PPC session refnum for write */
  111. char apiwritekind;                /* 0 = PPC, 1 = SPPC */
  112. unsigned long apiwritemsgid;    /* SPPC/PPC message id of notify request */
  113. unsigned char apikberr;            /* error code for API input processing */
  114.  
  115. /* current settings, intialized to defaults */
  116. char cshostname[128] = "";
  117. char cskybdname[256] = "default";
  118. char csnlname[256];        /* initialized at startup from first menu item */
  119. char cssndname[256];    /* initialized at startup from dfltsoundname */
  120. settings_list cs = {
  121.     {0x00, 0x40,     /* attributes */
  122.      0x80, 0x20, 
  123.      0x30, 0x10,
  124.      0x80},
  125.     0,                /* dblevel */
  126.                     /* setsflg */
  127. #ifdef ASYNC
  128.     1,
  129. #else
  130. #ifdef TCP
  131.     2,
  132. #else
  133.     0,
  134. #endif
  135. #endif
  136.     1,                /* timeout */
  137.     15,                /* retries */
  138.     1,                /* insreset */
  139.     1,                /* impnull */
  140.     1,                /* digitpfk */
  141.     23,                /* mousepf */
  142.     0,                /* basecolor */
  143.     1,                /* exactcolor */
  144.     DFLTWHITE,        /* usrwhite */
  145.     DFLTYELLOW,        /* usryellow */
  146.     DFLTPINK,        /* usrpink */
  147.     DFLTTURQUOISE,    /* usrturquoise */
  148.     DFLTGREEN,        /* usrgreen */
  149.     DFLTRED,        /* usrred */
  150.     DFLTBLUE,        /* usrblue */
  151.     DFLTBLACK,        /* usrblack */
  152.     DFLTBACK,        /* usrback */
  153.     DFLTBLUE,        /* usrstat */
  154.     12,                /* dfltptsize */
  155.     12,                /* altptsize */
  156.     24,                /* altrows */
  157.     80,                /* altcols */
  158.     24,                /* custrows */
  159.     80,                /* custcols */
  160.     0,                /* windpth */
  161.     0,                /* windptv */
  162.     0,                /* invertbw */
  163.     1,                /* stat_time */
  164.     0,                /* curpos */
  165.     0,                /* blockcurs */
  166.     1,                /* ext3270 */
  167.     1,                /* std_brack */
  168.     0,                /* windmax */
  169.     1,                /* repnull */
  170.     1,                /* savewpos */
  171.     1,                /* autoconn */    
  172.     'ttxt',            /* text_creator */
  173.     0,                /* simps */
  174.     0                /* unused */
  175.     };
  176.  
  177. /* settings to/from file */
  178. char *fshostname;
  179. char *fskybdname;
  180. char *fsnlname;
  181. char *fssndname;
  182. settings_list fs;
  183.  
  184. char s_fName[64] = "";            /* last filename used */
  185. char logon;                        /* user logged-in to server */
  186. char specuser = 0;                /* user with special privileges */
  187. char ScrDmpSav;                    /* saved ScrDmpEnb byte */
  188. char sw_bgrnd;                    /* running in switcher background */
  189. char sw_upd;                    /* update occurred in background */
  190. char sw_beep;                    /* beep occurred in background */
  191. short ioerror;                    /* terminal I/O error code */
  192. long at_last;                    /* time of last AppleTalk I/O */
  193. unsigned char nlstdata;            /* last type of data write */
  194. unsigned char nlstopcd;            /* last write op-code */
  195. char ewamode;                    /* logical erase/write state: 0 = default, 1 = alt. */
  196. Point mousehit;                    /* last hit in dialog box */
  197. char int_active;                /* interrupt routine running */
  198. char pndbig;                    /* pending big data */
  199. char pndbeep;                    /* pending bell */
  200. char pndinv;                    /* pending invldscr */
  201. char pndclr;                    /* pending clrpict */
  202. char pndnewmode;                /* pending newmode */
  203. char pndmode;                    /* mode for pending newmode */
  204. char needwrite;                    /* call to writescr needed */
  205. char kb_err;                    /* kb entry error code */
  206. char wr_active;                    /* statline write active flag */
  207. char colormac;                    /* true if we have color QuickDraw */
  208. char newroms;                    /* Mac has 128K ROMs or newer */
  209. unsigned char syslevel;            /* level of system software (1st digit) */
  210. char zoomok;                    /* true if window can be zoomed */
  211. char mf_bgrnd;                    /* in background under MultiFinder */
  212. short ses_altrows;                /* EWA rows for this session */
  213. short ses_altcols;                /* EWA columns for this session */
  214. short ses_altptsize;            /* EWA point size for this session */
  215. short ses_dfltptsize;            /* default point size for this session */
  216. char ses_windmax;                /* max. window size flag for this session */
  217. short cur_rows;                    /* row count for current display */
  218. short cur_cols;                    /* column count for current display */
  219. short cur_ptsize;                /* point size for current display */
  220. char cur_mode;                    /* current display mode: 0 = normal, 1 = alt. */
  221. char ftpcopen;                    /* FTP control connection open */
  222. char ftpdopen;                    /* FTP data connection open */
  223. char ftplopen;                    /* FTP list connection open */
  224. char fixbracket;                /* don't use GE with [, ] */
  225. char wtitle[256];                /* title for our window */
  226. char savepict;                    /* save graphics in PICT file */
  227. Handle xtabh;                    /* handle to EBCDIC to Mac ASCII xtab */
  228. THPrint hPrint;                    /* print record handle */
  229. char prtinit;                    /* flag for printing intialization */
  230. char textsel;                    /* text selected for cut/copy/clear */
  231. unsigned char **kb_handle;        /* handle to current keyboard mapping */
  232. unsigned char **nl_handle;        /* handle to current language mapping */
  233. short rowmax9;                    /* maximum no. of rows for 9-point font */
  234. short colmax9;                    /* maximum no. of columns for 9-pt. font */
  235. short rowmax12;                    /* maximum no. of rows for 12-point font */
  236. short colmax12;                    /* maximum no. of columns for 12-pt. font */
  237. unsigned char nltab[256];        /* national language translation table */
  238. short stdfont;                    /* no. of standard font (add 2 for bold) */
  239. char textmap;                    /* flag for presence of text bitmap */
  240. char plainala;                    /* if true, suppress ALA overstrikes */
  241. Handle sndhandle;                /* handle to 'snd ' resource for beep */
  242. char sndactive;                    /* true while sound is being played */
  243. SndChannelPtr scp;                /* pointer for async sound channel */
  244.                                 /* name for default sound */
  245. unsigned char dfltsoundname[] = "System Alert Sound";
  246. char wposok;                    /* true if saved window position is valid */
  247. OSType text_creator;            /* creator for text files */
  248. char smgr_sppc;                    /* true if session manger registered ok */
  249. char sess_sppc;                    /* true if session registered ok */
  250. short smgrrefnum;                /* session manager SPPC refnum */
  251. short sessrefnum;                /* session SPPC refnum */
  252. char gestaltavail;                /* Gestalt is available */
  253. char ppcavail;                    /* PPC is available */
  254. unsigned long ppcflags;            /* PPC flags from Gestalt */
  255. char smgrppc;                    /* true if session mananger opened a port */
  256. char sessppc;                    /* true if session opened a port */
  257. short smgrpref;                    /* port refnum for session manager */
  258. short sesspref;                    /* port refnum for session */
  259. queueinfo paramqueue;            /* PPC param block queue */
  260. queueinfo clientqueue;            /* PPC client record queue */
  261. queueinfo dataqueue;            /* PPC data block queue */
  262.  
  263. RgnHandle cliprgn;                /* regions for grow icon handling */
  264. RgnHandle destrgn;
  265. RgnHandle temprgn;
  266.  
  267. /* unsigned long ticktime;             !!!!! elapsed time in tick count */
  268.